import template
import common
import json


def postman2py(body: dict):
    head = 'import json\nimport os\n\n\n'
    for items in body['item']:
        content = ''
        # for item in items['item']:
        #     content += template.template(item)
        common.generate_file(items['name'], head + content)


def get_postman(path):
    with open(path, 'r', encoding='UTF-8') as postman_f:
        result_dict = json.load(postman_f)
        return result_dict
